# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Tensor do
  @moduledoc """
  A tensor value type.

  ## Attributes

  *   `boolVal` (*type:* `list(boolean())`, *default:* `nil`) - Type specific representations that make it easy to create tensor protos in all languages. Only the representation corresponding to "dtype" can be set. The values hold the flattened representation of the tensor in row major order. BOOL
  *   `bytesVal` (*type:* `list(String.t)`, *default:* `nil`) - STRING
  *   `doubleVal` (*type:* `list(float())`, *default:* `nil`) - DOUBLE
  *   `dtype` (*type:* `String.t`, *default:* `nil`) - The data type of tensor.
  *   `floatVal` (*type:* `list(number())`, *default:* `nil`) - FLOAT
  *   `int64Val` (*type:* `list(String.t)`, *default:* `nil`) - INT64
  *   `intVal` (*type:* `list(integer())`, *default:* `nil`) - INT_8 INT_16 INT_32
  *   `listVal` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Tensor.t)`, *default:* `nil`) - A list of tensor values.
  *   `shape` (*type:* `list(String.t)`, *default:* `nil`) - Shape of the tensor.
  *   `stringVal` (*type:* `list(String.t)`, *default:* `nil`) - STRING
  *   `structVal` (*type:* `%{optional(String.t) => GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Tensor.t}`, *default:* `nil`) - A map of string to tensor.
  *   `tensorVal` (*type:* `String.t`, *default:* `nil`) - Serialized raw tensor content.
  *   `uint64Val` (*type:* `list(String.t)`, *default:* `nil`) - UINT64
  *   `uintVal` (*type:* `list(integer())`, *default:* `nil`) - UINT8 UINT16 UINT32
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :boolVal => list(boolean()) | nil,
          :bytesVal => list(String.t()) | nil,
          :doubleVal => list(float()) | nil,
          :dtype => String.t() | nil,
          :floatVal => list(number()) | nil,
          :int64Val => list(String.t()) | nil,
          :intVal => list(integer()) | nil,
          :listVal => list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Tensor.t()) | nil,
          :shape => list(String.t()) | nil,
          :stringVal => list(String.t()) | nil,
          :structVal =>
            %{
              optional(String.t()) =>
                GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Tensor.t()
            }
            | nil,
          :tensorVal => String.t() | nil,
          :uint64Val => list(String.t()) | nil,
          :uintVal => list(integer()) | nil
        }

  field(:boolVal, type: :list)
  field(:bytesVal, type: :list)
  field(:doubleVal, type: :list)
  field(:dtype)
  field(:floatVal, type: :list)
  field(:int64Val, type: :list)
  field(:intVal, type: :list)
  field(:listVal, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Tensor, type: :list)
  field(:shape, type: :list)
  field(:stringVal, type: :list)
  field(:structVal, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Tensor, type: :map)
  field(:tensorVal)
  field(:uint64Val, type: :list)
  field(:uintVal, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Tensor do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Tensor.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Tensor do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
